package logic

import (
	"context"
	"fmt"
	"k8s.io/apimachinery/pkg/util/json"

	"getway/internal/svc"
	"getway/internal/types"

	"github.com/zeromicro/go-zero/core/logx"
)

type AliNotifyLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

func NewAliNotifyLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AliNotifyLogic {
	return &AliNotifyLogic{
		Logger: logx.WithContext(ctx),
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (l *AliNotifyLogic) AliNotify(req *types.AliNotifRequest) (resp *types.AliNotifResponse, err error) {
	// todo: add your logic here and delete this line
	fmt.Println("****************支付宝的请求参数****************")
	reqStr, err := json.Marshal(req)
	if err != nil {
		return nil, err
	}

	fmt.Println(string(reqStr))
	return
}
